/*
	CargoEnhancement.h
	(c)2008 Palestar Inc, Jeff Everett
*/

#ifndef CARGOENHANCEMENT_H
#define CARGOENHANCEMENT_H

#include "Constants.h"
#include "NounCargo.h"
#include "GameDll.h"

//----------------------------------------------------------------------------

// forward declare
class NounEnhancement;

class DLL CargoEnhancement : public NounCargo
{
public:
	DECLARE_WIDGET_CLASS();
	DECLARE_PROPERTY_LIST();

	// Types
	typedef Reference<CargoEnhancement>				Ref;
	typedef WidgetReference<CargoEnhancement >		wRef;

	// Construction
	CargoEnhancement();
	CargoEnhancement( ClassKey a_classKey );		// create a cargo item

	// Widget interface
	bool					read( InStream & );
	// BaseNode interface
	void					onAttached();
	void					onDetaching();
	// Noun interface
	void					initialize();
	void					simulate( dword nTick );

	const ClassKey &		enhancementKey() const;								// key of the nounenhancement in the cargo

	void					updateName();
	CharString				getInfo();
	virtual CharString		status() const;					// get the target status of this object

	NounEnhancement *		enhancement() const;
	void					createEnhancement();
	virtual float			baseSignature() const;			// what is the default signature for this noun (by default the radius)


private:
	// Data
	float					m_nRemovalTime;
	ClassKey				m_enhancementClassKey;
	NounEnhancement::Ref	m_pEnhancement;
};


inline NounEnhancement * CargoEnhancement::enhancement() const
{
	return m_pEnhancement;
}


inline const ClassKey & CargoEnhancement::enhancementKey() const
{
	return m_enhancementClassKey;
}

//----------------------------------------------------------------------------
#endif

//----------------------------------------------------------------------------
//EOF
